package com.seuic.hid_demo.util.ext

import com.inuker.bluetooth.library.BluetoothClient
import com.inuker.bluetooth.library.search.SearchRequest
import com.inuker.bluetooth.library.search.response.SearchResponse
import java.net.ResponseCache


/**
 * @Desc
 * @author KP
 * @date 2020/12/17 16:33
 * @version
 */

val request: SearchRequest by lazy {
    SearchRequest.Builder()
        .searchBluetoothLeDevice(3000, 3) // 先扫BLE设备3次，每次3s
        .searchBluetoothClassicDevice(5000) // 再扫经典蓝牙5s
        .searchBluetoothLeDevice(2000) // 再扫BLE设备2s
        .build()
}

fun BluetoothClient.search(responseCache: SearchResponse) {
    search(request, responseCache)
}